package test3_6;

public class homework4_9 {
    public static void main(String[] args) {
        /*
        用while做 鸡兔同笼。鸡兔一共有50只，脚一共有160只
        问鸡和兔各多少只?要求鸡兔至少一样一只。
         */
        int Chicken = 1;
        int Rabbit = 49;
        while (2*Chicken+4*Rabbit!=160){
            Chicken++;
            Rabbit--;
        }
        System.out.println("鸡"+Chicken+"只"+" "+"兔"+Rabbit+"只");
    }
}
